package com.itheima.usermanager1.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.itheima.usermanager1.pojo.EasyUIPageBean;
import com.itheima.usermanager1.service.UserService;

@Controller
@RequestMapping("user")
public class UserController {
	
	@Autowired
	private UserService userService;

	@RequestMapping("page/{pageName}")
	public String toPage(@PathVariable("pageName")String pageName){
		return pageName;
	}
	
	@RequestMapping("list")
	@ResponseBody
	public EasyUIPageBean queryUserListByPage(@RequestParam("page")Integer pageNum,@RequestParam("rows")Integer pageSize){
		EasyUIPageBean easyUIPageBean = userService.queryUserListByPage(pageNum, pageSize);
		return easyUIPageBean;
	}
}
